package component
{
	import flash.events.Event;
	
	import mx.collections.ICollectionView;
	import mx.controls.DataGrid;

	public class CustomDatagrid extends DataGrid
	{
		public function CustomDatagrid()
		{
			super();
		}
		//custom event that tells that the data grid just finished the rendering
		public static const UPDATEROWCOUNT:String = "rowCountChangeEvent";
		
		private var _rows:int;
		private var _groupMode:Boolean;
		
		
			
		public function get groupMode():Boolean
		{
			return _groupMode;
		}

		public function set groupMode(value:Boolean):void
		{
			_groupMode = value;
		}

		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
			super.updateDisplayList(unscaledWidth,unscaledHeight);
			
			if(_rows !=this.rowCount){
				dispatchEvent(new Event("rowCountChangeEvent"));
				_rows=this.rowCount;
				trace("Row has changed !!");
			}
		}
	}
}